package embedding

import (
	"context"
	"encoding/json"
	"fmt"

	"github.com/volcengine/volcengine-go-sdk/service/arkruntime"
	"github.com/volcengine/volcengine-go-sdk/service/arkruntime/model"
)
func GetEmbeddingByText(text string) string{
        client := arkruntime.NewClientWithApiKey(
                "77db7d27-81e7-4992-8bdf-a7e26516c774",
        )
        ctx := context.Background()
        
        req := model.MultiModalEmbeddingRequest{
                Model: "ep-20251011234557-lk4xg",
                Input: []model.MultimodalEmbeddingInput{
                        {
                                Type:     model.MultiModalEmbeddingInputTypeText,
                                Text:     &text,
                        },
                },
        }

        resp, err := client.CreateMultiModalEmbeddings(ctx, req)
        if err != nil {
                fmt.Printf("multimodal embeddings error: %v\n", err)
                return ""
        }
        s, _ := json.Marshal(resp)
        return string(s)
}

